#!/usr/bin/env python

import os
import datetime

class GeoThermal(object):
    '''GeoThermal class
    
    @author Julot <andy.julot@gmail.com>
    @since Monday, February 20, 2012. 02:09 PM'''
    
    _data = None
    
    def add(self, data):
        self.dateTime = datetime.datetime.now()
        self._data = data.strip()
    
    @property
    def data(self):
        return self._data
        
    def save(self):
        if not self._data: return
        
        d = (self.dateTime.year, self.dateTime.month, self.dateTime.day)
        path = os.path.join('data', '%s-%02d-%02d.txt' % d)
        data = open(path, 'a')
        data.write('%s\n' % self._data)
        data.close()
